<?php 
	if($_SERVER['REQUEST_METHOD'] == "POST"){
		if(isset($_POST['id']) && !empty($_POST['id'])){
			//delete from user table
			unset($obj);
			$table_def 	= array('filter' => 'id = '.$_POST['id']);
			$obj = new User($table_def);
			$obj->Delete();

			//delete from user_group
			unset($obj);
			$ugparams = array('filter' => 'user_id ='.$_POST['id']);
			$obj = new UserGroup($ugparams);
			$obj->Delete();

			//delete from user_patient
			unset($obj);
			$upparams = array('filter' => 'user_id ='.$_POST['id']);
			$obj = new UserPatient($upparams);
			$obj->Delete();

			//delete from user_non_practicioner
			unset($obj);
			$unpparams = array('filter' => 'user_id ='.$_POST['id']);
			$obj = new UserNonPracticioner($unpparams);
			$obj->Delete();

			//delete from user_practicioner
			unset($obj);
			$uprparams = array('filter' => 'user_id ='.$_POST['id']);
			$obj = new UserPracticioner($uprparams);
			$obj->Delete();
		}
	}
?>